package com.breakfast.fun.data.entity.user;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/8/23.
 */
public class UserData {

    /**
     * id : 5407
     * mobile : 18359928629
     * nickname : 18359928629
     * sex : 保密
     * cityId : 1
     * cityName : 福州市
     * builderId : 450
     * builderName : 山亚创业园
     * lastLoginTime : 2016-08-23 11:22:34
     * regeistDate : 2016-07-29 15:32:41
     * rank : R1
     * score : 0
     * photo : http://m.52letsgo.cn
     * money : 16.85
     * dynamicCount : 2
     * fansCount : 0
     * followCount : 0
     * inviteCount : 2
     * userSign : 363ab518ec0176a96bdce6ec2ebed120
     */

    private int id;
    private String mobile;
    private String nickname;
    private String sex;
    private int cityId;
    private String cityName;
    private int builderId;
    private String builderName;
    private String lastLoginTime;
    private String regeistDate;
    private String rank;
    private int score;
    private String photo;
    private double money;
    private int dynamicCount;
    private int fansCount;
    private int followCount;
    private int inviteCount;
    private String userSign;
    private String birthday;

    public static UserData objectFromData(String str) {

        return new Gson().fromJson(str, UserData.class);
    }

    public static List<UserData> arrayUserFromData(String str) {

        Type listType = new TypeToken<ArrayList<UserData>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getCityId() {
        return cityId;
    }

    public void setCityId(int cityId) {
        this.cityId = cityId;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public int getBuilderId() {
        return builderId;
    }

    public void setBuilderId(int builderId) {
        this.builderId = builderId;
    }

    public String getBuilderName() {
        return builderName;
    }

    public void setBuilderName(String builderName) {
        this.builderName = builderName;
    }

    public String getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(String lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getRegeistDate() {
        return regeistDate;
    }

    public void setRegeistDate(String regeistDate) {
        this.regeistDate = regeistDate;
    }

    public String getRank() {
        return rank;
    }

    public void setRank(String rank) {
        this.rank = rank;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public int getDynamicCount() {
        return dynamicCount;
    }

    public void setDynamicCount(int dynamicCount) {
        this.dynamicCount = dynamicCount;
    }

    public int getFansCount() {
        return fansCount;
    }

    public void setFansCount(int fansCount) {
        this.fansCount = fansCount;
    }

    public int getFollowCount() {
        return followCount;
    }

    public void setFollowCount(int followCount) {
        this.followCount = followCount;
    }

    public int getInviteCount() {
        return inviteCount;
    }

    public void setInviteCount(int inviteCount) {
        this.inviteCount = inviteCount;
    }

    public String getUserSign() {
        return userSign;
    }

    public void setUserSign(String userSign) {
        this.userSign = userSign;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    @Override
    public String toString() {
        return "UserData{" +
                "id=" + id +
                ", mobile='" + mobile + '\'' +
                ", nickname='" + nickname + '\'' +
                ", sex='" + sex + '\'' +
                ", cityId=" + cityId +
                ", cityName='" + cityName + '\'' +
                ", builderId=" + builderId +
                ", builderName='" + builderName + '\'' +
                ", lastLoginTime='" + lastLoginTime + '\'' +
                ", regeistDate='" + regeistDate + '\'' +
                ", rank='" + rank + '\'' +
                ", score=" + score +
                ", photo='" + photo + '\'' +
                ", money=" + money +
                ", dynamicCount=" + dynamicCount +
                ", fansCount=" + fansCount +
                ", followCount=" + followCount +
                ", inviteCount=" + inviteCount +
                ", userSign='" + userSign + '\'' +
                ", birthday='" + birthday + '\'' +
                '}';
    }
}
